# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-net-tftp
_pkgname=Net-TFTP
pkgver=0.1901
pkgrel=11
pkgdesc='TFTP Client class.'
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
url='http://search.cpan.org/~gbarr/Net-TFTP-0.19/TFTP.pm'
source=("http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/$_pkgname-$pkgver.tar.gz")
sha512sums=('8e5ce32838921d8d2b247bd851f2dba5e4982df7c1e7bfb0f867533d59818b624f856bb1575df157b88e56eddde5dd8bf7bc05d21d6972136fb99f02ea3bc667')

prepare() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
    PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Makefile.PL
}

build() {
  cd "$_pkgname-$pkgver"

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

